<?xml version="1.0" encoding="utf-8" ?>
<Mapping xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<Entity type="Person" table="Person">
		<Id field="Id" >
			<Generator name="assigned" >
				<Property name="dbType">Int32</Property>
			</Generator>
		</Id>
		<Attribute name="Age" field="Age" db-type="Int32" />
		<Attribute name="Lastname" field="Lastname" db-type="AnsiString" size="255" />
		<Attribute name="Firstname" field="Firstname" db-type="AnsiString" size="255" />
		<Attribute name="Acceleration" field="Acceleration" db-type="Decimal" scale="14" precision="28"/>
		
		<Reference name="Prout" entityChild="Person" discriminator="Role">
			<Rule parentField="Id" childTable="IndexTable" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Person" childField="Id" />
		</Reference>
		
		<Reference name="Partners" entityChild="Person" discriminator="Role">
			<Rule parentField="Id" childTable="IndexTable" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Person" childField="Id" />
		</Reference>
		
		<Reference name="Brother" entityChild="Person" discriminator="Role">
			<Rule parentField="Id" childTable="IndexTable" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Person" childField="Id" />
		</Reference>
		
		<Reference name="Friends" entityChild="Thing" discriminator="Role">
			<Rule parentField="Id" childTable="IndexTable" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Thing" childField="Id" />
		</Reference>
		
		<Reference name="BestFriend" entityChild="Person">
			<Rule parentField="FK_BestFriend" childTable="Person" childField="PersonId" />
		</Reference>
		
		<Reference name="MyCompany" entityChild="Company" discriminator="Role">
			<Rule parentField="Id" childTable="IndexTable" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Company" childField="Id" />
		</Reference>
		
		<Reference name="Address" entityChild="Address" discriminator="Role">
			<Rule parentField="PersonId" childTable="IndexTable" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Address" childField="AddressId" />
		</Reference>
	</Entity>
	
	<Entity type="Employee" table="Person" discriminator="Type" discriminator-value="Employee">
		<Id field="Id" >
			<Generator name="assigned" >
				<Property name="dbType">Int32</Property>
			</Generator>
		</Id>
		<Attribute name="Salary" field="Salary" db-type="Double"/>	
	</Entity>
	
	<Entity type="Address" table="Address">
		<Id field="Id" >
			<Generator name="assigned" >
				<Property name="dbType">Int32</Property>
			</Generator>
		</Id>
		<Attribute name="City" field="City" db-type="String"/>	
	</Entity>
	
	<Entity type="Secretary" table="Person" discriminator="Type" discriminator-value="Secretary">
		<Id field="Id" >
			<Generator name="assigned" >
				<Property name="dbType">Int32</Property>
			</Generator>
		</Id>
		<Attribute name="Bonus" field="Bonus" db-type="Int32"/>	
	</Entity>
	
	<Entity type="Worker" table="Person" discriminator="Type" discriminator-value="Worker">
		<Id field="Id" >
			<Generator name="assigned">
				<Property name="dbType">Int32</Property>
			</Generator>
		</Id>
		<Attribute name="Place" field="Place" db-type="String"/>	
	</Entity>
	
	<Entity type="Thing" table="Thing">
		<Id field="Id" >
			<Generator name="assigned" >
				<Property name="dbType">Int32</Property>
			</Generator>
		</Id>
		<Attribute name="Firstname" field="Firstname" db-type="AnsiString" size="255" />
		<Attribute name="Lastname" field="Lastname" db-type="AnsiString" size="255" />
	</Entity>
	
	<Entity type="Manager" table="Manager">
		<Id field="Id" >
			<Generator name="assigned" >
				<Property name="dbType">Int32</Property>
			</Generator>
		</Id>
		<Reference name="MyCompany" entityChild="Company">
			<Rule parentField="FK_Company" childTable="Company" childField="Id" />
		</Reference>
	</Entity>
	
	<Entity type="Company" table="Company">
		<Id field="Id" >
			<Generator name="assigned" >
				<Property name="dbType">Int32</Property>
			</Generator>
		</Id>
		<Attribute name="Name" field="Name" db-type="AnsiString" size="255" />
	</Entity>
	
	<Entity type="FlaggedCategory" table="FlaggedCategory">
		<Id field="Id" >
			<Generator name="assigned" >
				<Property name="dbType">Int32</Property>
			</Generator>
		</Id>
		<Attribute name="FlaggedCategory" field="FlaggedCategory" db-type="AnsiString" size="255" />
	</Entity>
	
	<Entity type="Category" table="Category">
		<Id field="Id" >
			<Generator name="assigned" >
				<Property name="dbType">Int32</Property>
			</Generator>
		</Id>
		<Attribute name="Category" field="Category" db-type="AnsiString" />
	</Entity>
	
	<Entity type="SerializableTypes" table="SerializableTypes">
		<Id field="Id" >
			<Generator name="assigned" >
				<Property name="dbType">Int32</Property>
			</Generator>
		</Id>
		<Attribute name="StringCollection" field="StringCollection"	db-type="Binary" size="1024" />
	</Entity>
	
	<Entity type="ComplexTypes" table="ComplexTypes">
		<Id field="Id" >
			<Generator name="assigned" >
				<Property name="dbType">Int32</Property>
			</Generator>
		</Id>
		<Attribute name="array2" field="array2" db-type="Binary" size="1024" />
		<Attribute name="array1" field="array1" db-type="Binary" size="1024" />
		<Attribute name="datetime" field="datetime" db-type="DateTime" />
		<Attribute name="timespan" field="timespan" db-type="Object" />
	</Entity>
	
	<!-- Test for "abstract" class -->
	
	<Entity type="B" table="B">
		<Id field="Id">
			<Generator name="assigned">
				<Property name="dbType">Int32</Property>
			</Generator>
		</Id>
		<Attribute name="a" field="a" db-type="AnsiString" size="255" />
		<Attribute name="b" field="b" db-type="AnsiString" size="255" />
	</Entity>
	<Entity type="C" table="C">
		<Id field="Id">
			<Generator name="assigned">
				<Property name="dbType">Int32</Property>
				<Property name="seed">10</Property>
				<Property name="increment">2</Property>
			</Generator>
		</Id>
		<Attribute name="a" field="a" db-type="AnsiString" size="255" />
		<Attribute name="c" field="c" db-type="AnsiString" size="255" />
	</Entity>
	
	<!-- Test for references inheritance -->
	
	<Entity type="Test:D" table="D">
		<Id field="did">
			<Generator name="assigned">
				<Property name="dbType">String</Property>
			</Generator>
		</Id>
		<Attribute name="d" field="d" db-type="AnsiString" size="255" />
		<Reference name="Refs" entityChild="Test:E">
			<Rule parentField="did" childTable="IndexTable" childField="FK_did" />
			<Rule parentField="FK_eid" childTable="e" childField="eid" />
		</Reference>
		<Reference name="Refs" entityChild="Test:F">
			<Rule parentField="did" childTable="IndexTable" childField="FK_did" />
			<Rule parentField="FK_eid" childTable="f" childField="eid" />
		</Reference>
	</Entity>
	<Entity type="Test:E" table="E">
		<Id field="eid">
			<Generator name="assigned">
				<Property name="dbType">String</Property>
			</Generator>
		</Id>
		<Attribute name="e" field="e" db-type="AnsiString" size="255" />
	</Entity>
	<Entity type="Test:F" table="F">
		<Id field="eid">
			<Generator name="assigned">
				<Property name="dbType">String</Property>
			</Generator>
		</Id>
		<Attribute name="e" field="e" db-type="AnsiString" size="255" />
		<Attribute name="f" field="f" db-type="AnsiString" size="255" />
	</Entity>
	
	<!-- Test for carole's bug -->
	<Entity type="Test:Contract" table="Test_Contract">
		<Id field="ContractId">
			<Generator name="assigned">
				<Property name="dbType">Int32</Property>
			</Generator>
		</Id>
		<Attribute name="Heading" field="Heading" db-type="String" size="50" />
		<Reference name="MyCompany" entityChild="Test:Company">
			<Rule parentField="CompanyId" childTable="Test_Company" childField="CompanyId" />
		</Reference>
	</Entity>
	<Entity type="Test:Company" table="Test_Company">
		<Id field="CompanyId">
			<Generator name="assigned">
				<Property name="dbType">Int32</Property>
			</Generator>
		</Id>
		<Attribute name="Name" field="Name" db-type="String" size="50" />
	</Entity>
	
	<!-- Test for linked references : pe.Load("X.YRef.ZRef") -->
	<Entity type="X" table="X">
		<Id field="XId">
			<Generator name="assigned">
				<Property name="dbType">Int32</Property>
			</Generator>
		</Id>
		<Attribute name="xvalue" field="xvalue" db-type="String" size="50" />
		
		<Reference name="YRef" entityChild="Y">
			<Rule parentField="XId" childTable="IndexTable3" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Y" childField="YId" />
		</Reference>
	</Entity>
	
	<Entity type="Y" table="Y">
		<Id field="YId">
			<Generator name="assigned">
				<Property name="dbType">Int32</Property>
			</Generator>
		</Id>
		<Attribute name="yvalue" field="yvalue" db-type="String" size="50" />
		
		<Reference name="ZRef" entityChild="Z">
			<Rule parentField="YId" childTable="IndexTable3" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Z" childField="ZId" />
		</Reference>
	</Entity>
	
	<Entity type="Z" table="Z">
		<Id field="ZId">
			<Generator name="assigned">
				<Property name="dbType">Int32</Property>
			</Generator>
		</Id>
		<Attribute name="zvalue" field="zvalue" db-type="String" size="50" />
	</Entity>
	
</Mapping>